package com.tushu.view;
import java.awt.CardLayout;


import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.UIManager;
import javax.swing.border.EmptyBorder;

import com.tushu.view.admin.BookManage;
import com.tushu.view.admin.DataCollection;
import com.tushu.view.admin.LendLog;
import com.tushu.view.admin.StudentManage;

import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

public class AdminWin extends JFrame {

	private JPanel contentPane;
	
	private CardLayout cardLayout=new CardLayout();


	/**
	 * Create the frame.
	 */
	public AdminWin() {
		try {
			UIManager.setLookAndFeel(   UIManager.getSystemLookAndFeelClassName()); 
		} catch (Exception e) {
			// TODO: handle exception
		}
		setTitle("\u7CFB\u7EDF\u540E\u53F0");
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 564, 482);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JPanel panel = new JPanel();
		panel.setBounds(0, 43, 550, 402);
		contentPane.add(panel);
		panel.setLayout(cardLayout);
		panel.add(new StudentManage(),"stu");

		panel.add(new BookManage(), "book");

		panel.add(new LendLog(), "log");

		panel.add(new DataCollection(), "dataCollection");
		
		
		JButton btnNewButton = new JButton("\u5B66\u751F\u7BA1\u7406");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				cardLayout.show(panel, "stu");
			}
		});
		btnNewButton.setBounds(10, 10, 97, 23);
		contentPane.add(btnNewButton);
		
		JButton btnNewButton_1 = new JButton("\u4E66\u7C4D\u7BA1\u7406");
		btnNewButton_1.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				cardLayout.show(panel, "book");
			}
		});
		btnNewButton_1.setBounds(123, 10, 97, 23);
		contentPane.add(btnNewButton_1);
		
		JButton btnNewButton_2 = new JButton("\u501F\u9605\u4E00\u89C8");
		btnNewButton_2.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				cardLayout.show(panel,"log");
			}
		});
		btnNewButton_2.setBounds(231, 10, 97, 23);
		contentPane.add(btnNewButton_2);
		
		JButton btnNewButton_3 = new JButton("\u6570\u636E\u6C47\u603B");
		btnNewButton_3.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {
				cardLayout.show(panel,"dataCollection");
			}
		});
		btnNewButton_3.setBounds(338, 10, 97, 23);
		contentPane.add(btnNewButton_3);
		
		JButton btnNewButton_4 = new JButton("\u9000\u51FA");
		btnNewButton_4.setBounds(445, 10, 97, 23);
		contentPane.add(btnNewButton_4);
	}
}
